package com.aizu.citybusdappe;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class BusStopInfo extends Activity implements OnClickListener{
    /** Called when the activity is first created. */
	private TextView Title;
	private Button Static;
	private Button back;
	private String url;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.info);
        Title = (TextView)findViewById(R.id.busstop);
        Static = (Button)findViewById(R.id.timetable);
        back = (Button)findViewById(R.id.back);
        Intent i = getIntent();
        String title = i.getStringExtra("Busname");
        url = i.getStringExtra("url");
        Title.setText(title);
        back.setOnClickListener(this);
        Static.setOnClickListener(this);

    }
    public void onClick(View v){
    	if(v == back){
    		//moveTaskToBack(true);
    		finish();
    	}
        else  if(v == Static){
        Intent intent = new Intent("android.intent.action.VIEW",Uri.parse(url));
    	startActivity(intent);
        }

    }
}
